import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/ManageHomeWork/GetHomeJobList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 获取教师的任课班级
export const GradesByTeacher = (params) => {
  return request({
    url: '/api/ManageHomeWork/GetTeacherClassSelect',
    method: 'get',
    params: {
      ...params,
    }
  })
}

// 教师的任课课程
export const CourseListByTeacher = (params) => {
  return request({
    url: '/api/ManageHomeWork/GetCourseTeacherSelect',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const GetWorkTypeList = (params) => {
  return request({
    // url: '/api/AppHomeWork/GetWorkTypeList',
    url: '/api/ManageHomeWork/GetWorkTypeList',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/school-service/job/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (row) => {
  return request({
    url: '/api/ManageHomeWork/DelHomeJob',
    method: 'post',
    data:row,
  })
}

export const add = (row) => {
  return request({
    url: '/api/ManageHomeWork/ModifyJob',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/ManageHomeWork/ModifyJob',
    method: 'post',
    data: row
  })
}

export const selectImgId = (params) => {
  return request({
    url: '/api/ManageHomeWork/GetJobFileIdByUil',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getTeacherByRelateId = () => {
  return request({
    url: '/api/PcPublicService/GetTeacherByRelateId',
    method: 'get',
    params: {}
  })
}

